package com.zhao.config;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MybatisPlusConfig {
@Bean
    public MybatisPlusInterceptor MybatisPlusInterceptor(){
        //创建对象
        MybatisPlusInterceptor mp = new MybatisPlusInterceptor();
        //追加分页拦截器
        mp.addInnerInterceptor(new PaginationInnerInterceptor());

        return mp;
    }
}
